<?php
defined('BASEPATH') or exit('No direct script access allowed');


class PatternController extends Admin_Controller {

    public function __construct() {
        try {
            parent::__construct();
            $this->load->service("SService/PatternService");
            $this->load->Model("PModel/V_Admin_model");
        } catch (\TPException $e) {
            exit($e->getRetJson());
        }
    }


    /**
     * 方法名 patternList
     *
     * @Name 获取方法列和角色方法列
     * @Desc 花型列表
     * @OpenFlag 是否开放,1开放0权限控制
     * @Author      zn
     * @Date 2021-11-15 09:30:37 星期一
     * @return      [type]                   [description]
     */
    public function patternList() {
        $res = $this->PatternService->patternList($_POST);
        exit(retSucc($res));
    }


    /**
     * 方法名 patternDelete
     *
     * @Name 获取方法列和角色方法列
     * @Desc 花型删除
     * @OpenFlag 是否开放,1开放0权限控制
     * @Author      zn
     * @Date 2021-11-15 09:30:37 星期一
     * @return      [type]                   [description]
     */
    public function patternDelete() {
        $res = $this->PatternService->patternDelete($_POST);
        exit(retSucc($res));
    }


    /**
     * 方法名 patternInfo
     *
     * @Name 获取方法列和角色方法列
     * @Desc 花型详情
     * @OpenFlag 是否开放,1开放0权限控制
     * @Author      zn
     * @Date 2021-11-15 09:30:37 星期一
     * @return      [type]                   [description]
     */
    public function patternInfo() {
        $res = $this->PatternService->patternInfo($_POST);
        exit(retSucc($res));
    }


    /**
     * 方法名 patternPublic
     *
     * @Name 获取方法列和角色方法列
     * @Desc 花型公布
     * @OpenFlag 是否开放,1开放0权限控制
     * @Author      zn
     * @Date 2021-11-15 09:30:37 星期一
     * @return      [type]                   [description]
     */
    public function patternPublic() {
        $res = $this->PatternService->patternPublic($_POST);
        exit(retSucc($res));
    }


    /**
     * 方法名 patternImport
     *
     * @Name 获取方法列和角色方法列
     * @Desc 花型导入
     * @OpenFlag 是否开放,1开放0权限控制
     * @Author      zn
     * @Date 2021-11-15 09:30:37 星期一
     * @return      [type]                   [description]
     */
    public function patternImport() {
        $res = $this->PatternService->patternImport();
        exit(retSucc($res));
    }


    public function patternAdd() {
        $res = $this->PatternService->patternAdd($_POST);
        exit(retSucc($res));
    }


    public function patternSearch() {
        $res = $this->PatternService->patternSearch($_POST);
        exit(retSucc($res));
    }
    public function patternAddIndex() {
        $res = $this->PatternService->patternAddIndex($_POST);
        exit(retSucc($res));
    }




    public function PatternImgImport() {
        $res = $this->PatternService->PatternImgImport();
        exit(retSucc($res));
    }




    /**
     * [ changePublic]
     * @Name        changePublic
     * @Description 批量公布
     * @Author      DJC
     * @Date 2022-03-08 15:24:11
     * @return      [type]                   [description]
    */
    public function changePublic() {
        $res = $this->PatternService->changePublic($_POST);
        exit(retSucc($res));
    }

	public function imageSearch() {
        $_POST = file_get_contents("php://input");
		$res = $this->PatternService->imageSearch($_POST);
		exit(retSucc($res));
	}


    //获取所有的员工或者客户
    public function getAccountList(){
        $newlist = $this->PatternService->getAdminList();
        exit(retSucc($newlist));
    }


    /**
     * [ changePublic]
     * @Name        changePublic
     * @Description 批量设置权限人员
     * @Author      DJC
     * @Date 2022-03-08 15:24:11
     * @return      [type]                   [description]
    */
    public function ChangeViewPeople(){
        $res = $this->PatternService->ChangeViewPeople($_POST);
        exit(retSucc($res));
    }

}
